/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.gen.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.kpoint.core.base.KpointBaseEntity;
import lombok.Data;

import java.util.List;

/**
 * 代码生成-表信息Entity
 *
 * @author kongxiangsheng
 * @version 2018-08-16
 */
@Data
public class GenTable extends KpointBaseEntity {
    public static final String COL_NAME = "`name`";
    public static final String COL_COMMENTS = "`comments`";
    public static final String COL_PARENT_TABLE = "`parent_table`";
    public static final String COL_PARENT_TABLE_FK = "`parent_table_fk`";

    private static final long serialVersionUID = 1L;
    /**
     * 名称
     */
    @TableField(condition = SqlCondition.LIKE)
    private String name;
    /**
     * 描述
     */
    @TableField(condition = SqlCondition.LIKE)
    private String comments;
    /**
     * 表名-简写(去掉了项目中配置的前缀)
     */
    @TableField(exist = false)
    private String shortName;
    /**
     * 实体类名称(驼峰&首字母大写)
     */
    @TableField(exist = false)
    private String classNameCapital;
    /**
     * 实体类名称(驼峰&首字母小写)
     */
    @TableField(exist = false)
    private String classNameUnCapital;
    /**
     * 关联父表
     */
    private String parentTable;
    /**
     * 关联父表外键
     */
    private String parentTableFk;
    /**
     * 关联父表外键(java命名，首字母大写）
     */
    @TableField(exist = false)
    private String parentTableFKJavaNameCapital;
    /**
     * 关联父表外键(java命名，首字母小写）
     */
    @TableField(exist = false)
    private String parentTableFKJavaNameUnCapital;
    /**
     * 关联父表外键-大写
     */
    @TableField(exist = false)
    private String parentTableFkUpper;
    /**
     * 关联父表外键-小写
     */
    @TableField(exist = false)
    private String parentTableFkLower;
    /**
     * 是否含有父表
     */
    @TableField(exist = false)
    private String haveParentTable;
    /**
     * 是否含有子表
     */
    @TableField(exist = false)
    private String haveChildTable;
    /**
     * 表字段
     */
    @TableField(exist = false)
    private List<GenTableColumn> columnList = Lists.newArrayList();

    /**
     * 父表
     */
    @TableField(exist = false)
    private GenTable parent;
    /**
     * 所有子表
     */
    @TableField(exist = false)
    private List<GenTable> childTableList = Lists.newArrayList();
    /**
     * 是否含有主键
     */
    @TableField(exist = false)
    private String havePk;
    /**
     * 主键列表
     */
    @TableField(exist = false)
    private List<String> pkList = Lists.newArrayList();
    /**
     * entity文件的依赖包
     */
    @TableField(exist = false)
    private List<String> entityImportList = Lists.newArrayList();
    /**
     * dto文件的依赖包
     */
    @TableField(exist = false)
    private List<String> dtoImportList = Lists.newArrayList();
    /**
     * 错误码
     */
    @TableField(exist = false)
    private List<String> errorCodeDefineList = Lists.newArrayList();
    /**
     * 错误描述-中文
     */
    @TableField(exist = false)
    private List<String> errorMessageChineseList = Lists.newArrayList();
    /**
     * 错误描述英文
     */
    @TableField(exist = false)
    private List<String> errorMessageEnglishList = Lists.newArrayList();
    /**
     * service文件的依赖包
     */
    @TableField(exist = false)
    private List<String> serviceImportList = Lists.newArrayList();

    /**
     * 字段名&备注
     */
    @TableField(exist = false)
    private String nameAndComments;
}